package com.tjetc.dao;

import com.tjetc.entity.Appointment;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface AppointmentMapper {
    int insert(Appointment appointment);
    List<Integer> getAppointRoomByStuIdAndTime(@Param("userId") int userId,@Param("time") String time);
    List<Appointment> getMyAppointByUserId(int userId);
    @Select("select appointment.id,user.username,room.room_name,appointment.begin_time,appointment.end_time " +
            "from appointment inner join user on appointment.user_id=user.id  " +
            "inner join room on appointment.room_id=room.id where appointment.state=0")
    List<Map<String,String>> getAllDisagreeAppoint();
    int disposeAppointById(@Param("state") int state, @Param("id") int id);
    @MapKey("username")
    List<Map<String,String>> teaGetRoom(@Param("roomId") int id,@Param("time")String time);
    @MapKey("id")
    List<Map<String,String>> getAllAppoint();
}
